<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<link type="text/css" href="./assets/styles/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript" src="./assets/scripts/jquery.tablednd_0_5.js"></script>

		<script type="text/javascript">
		$(function() {
			init();

			$('.text_date').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy-mm-dd'
			});

			$('#button_addItem').click(function(){

				var table = $('#table_category');
				var count = 0;
				$(table).find('tr').each(function() {
					count++
				});
				var str = '<tr id="row' + count + '"><td><input type="text" name="child_category[' + count + ']" value="" class="text" /><input type="hidden" name="array_id[' + count + ']" value="" /></td><td><label><input type="radio" name="status[' + count + ']" value="1" checked />公開</label>&nbsp;<label><input type="radio" name="status[' + count + ']" value="0" />非公開</label></td></tr>';
				$(table).append(str);

				init();
			});

		});

		// trごとドラッグできるように
		var init = function() {
			$("table.draggable").tableDnD({
				onDragClass: "ui-state-highlight",
				onDrop: function() {
					// ドロップされたときの動作
				}
			});
		}
		</script>

	</head>
	<body id="">
{{ php }} include( MENU_FILE ); {{ /php }}
		<div id="header" class="clearfix"><div class="wrapper">
			<h1><a href="./">コントロールパネル</a></h1>
			<form id="form_logout" action="logout.php" method="post"><p>{{ $login.staff_name }} <input type="submit" id="button_logout" value="ログアウト" /></p></form>
		</div></div>
		<div id="container"><div class="wrapper">

			<h2>test</h2>

			
			<form name="fm" action="sample.php" method="post">

				<table class="formTable">
					<tbody>
						<tr>
							<th>date</th>
							<td>
								<input type="text" name="date" class="text_date" value="" />
							</td>
						</tr>
					</tbody>
				</table>


				<table class="formTable draggable" id="table_category">
					<thead>
						<tr>
							<th>text</th>
							<th>status</th>
						</tr>
					</thead>
					<tbody>

						<tr>
							<td>
								<input type="text" name="child_category[0]" value="AAAAAAAAAAAAAAAAAA" class="text" /><input type="hidden" name="array_id[0]" value="6" />
							</td>
							<td>
								<label><input type="radio" name="status[0]" value="1"  checked=checked />公開</label> <label><input type="radio" name="status[0]" value="0"  />非公開</label>
							</td>
						</tr>
						<tr>
							<td>
								<input type="text" name="child_category[1]" value="BBBBBBBBBBBBBBBBBBBBBBB" class="text" /><input type="hidden" name="array_id[1]" value="7" />
							</td>
							<td>
								<label><input type="radio" name="status[1]" value="1"  checked=checked />公開</label> <label><input type="radio" name="status[1]" value="0"  />非公開</label>
							</td>
						</tr>
						<tr>
							<td>
								<input type="text" name="child_category[2]" value="CCCCCCCCCCCCCCC" class="text" /><input type="hidden" name="array_id[2]" value="8" />
							</td>
							<td>
								<label><input type="radio" name="status[2]" value="1"  checked=checked />公開</label> <label><input type="radio" name="status[2]" value="0"  />非公開</label>
							</td>
						</tr>

					</tbody>
				</table>
				<p class="button">
					<button type="button" id="button_addItem"><span>add field</span></button>
				</p>


			</form>

		</div></div>
		<address>Copyright (C) SHIFT Inc. / All rightes reserved</address>
	</body>
</html>